/*
 * Created: Author: Aléx Carvalho / Date: Mar 4, 2015
 * 
 * Changed: $Author: ac280593@gmail.com $ / $Date: 2015-06-11 01:31:49 -0300 (Thu, 11 Jun 2015) $
 */
package com.cpm.view.zk.field;

import org.zkoss.zk.ui.HtmlBasedComponent;
import org.zkoss.zul.Textbox;

public class TextField extends AbstractInputField<String>{

    private final Textbox textbox = new Textbox();

    public TextField() {
    }

    public TextField(String value) {
        textbox.setValue(value);
    }
    
    @Override
    public void setValue(String value) {
        textbox.setValue(value);
    }

    @Override
    public String getValue() {
        return textbox.getValue();
    }

    @Override
    public boolean isEnabled() {
        return !textbox.isDisabled();
    }

    @Override
    public void setEnabled(boolean enable) {
        textbox.setDisabled(!enable);
    }

    @Override
    public HtmlBasedComponent getElement() {
        return textbox;
    }
    
}
